package com.lyf.emall.mapper;

import com.lyf.emall.bean.SysAuthority;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description:
 * @Author Lfy
 * @Date 2022/4/8-14:21
 */
@Mapper
public interface AuthorityMapper {

    /**
     * 根据角色名称查询角色权限信息
     * @param roleId
     * @return
     */
    List<SysAuthority> queryAuthorityNameByRoleId(Integer roleId);

    /**
     * 查询所有的权限信息
     * @return
     */
    List<SysAuthority> queryAllAuthority();

    /**
     * 根据权限字段查询权限信息
     * @param authorityKey
     * @return
     */
    SysAuthority queryAuthorityByAuthorityKey(String authorityKey);

    /**
     * 添加权限
     * @param sysAuthority
     * @return
     */
    Integer insertAuthority(SysAuthority sysAuthority);

    /**
     * 修改权限信息
     * @param sysAuthority
     * @return
     */
    Integer updateAuthority(SysAuthority sysAuthority);

    /**
     * 删除权限信息
     * @param authorityId
     * @return
     */
    Integer deleteAuthority(Integer authorityId);
}
